import { defineStore } from 'pinia'
export const PiniaLoading = defineStore({
    id: 'loadingId',
    state: () => ({
        mHasShow: false,
    }),
    actions: {
        showLoading() {
            console.log("显示加载框");
            this.mHasShow = true
        },
        hideLoading() {
            console.log("隐藏加载框");
            this.mHasShow = false
        }
    },
    getters: {
        getShowState(state) {
            return state.mHasShow
        }
    }
})


/**
 * 1.setup和非setup使用pinia
 * 2.访问其他store
 * 3.监听订阅
 * 4.缓存
 */